<div class="col-lg-12">
    <h1 class="page-header">Đơn hàng</h1>
</div>
<div class="col-lg-6">
    <h3>thông tin người mua hàng</h3>
    <table class="table">
        <tr>
            <td>Họ tên</td>
            <td>
                <?php echo $order->payment_name?>
            </td>
        </tr>
        <tr>
            <td>Email</td>
            <td>
                <?php echo $order->payment_email?>
            </td>
        </tr>
        <tr>
            <td>Số điện thoại</td>
            <td>
                <?php echo $order->payment_phone?>
            </td>
        </tr>
        <tr>
            <td>Địa chỉ</td>
            <td>
                <?php echo $order->payment_address?>
            </td>
        </tr>
    </table>
</div>
<div class="col-lg-6">
    <h3>thông tin người nhận hàng</h3>
    <table class="table">
        <tr>
            <td>Họ tên</td>
            <td>
                <?php echo $order->shipping_name?>
            </td>
        </tr>
        <tr>
            <td>Email</td>
            <td>
                <?php echo $order->shipping_email?>
            </td>
        </tr>
        <tr>
            <td>Số điện thoại</td>
            <td>
                <?php echo $order->shipping_phone?>
            </td>
        </tr>
        <tr>
            <td>Địa chỉ</td>
            <td>
                <?php echo $order->shipping_address?>
            </td>
        </tr>
    </table>
</div>

<div class="col-lg-12">
   <?php
    $form = $this->beginWidget('booster.widgets.TbActiveForm', array('htmlOptions' => array('class' => '')));
   ?>
        <div class="form-group">
            <label for="exampleInputEmail1">Tình trạng đơn hàng</label>
            <select class="form-control" style="width: 300px" name="status_update">
                <?php foreach($arrayStatus as $key => $value):?>
                    <option value="<?php echo $key?>" <?php echo $order->status == $key?"selected='selected'":""?>><?php echo $value?></option>
                <?php endforeach;?>
            </select>
            <br/>
            <input type="submit" name="" value="Cập nhật" class=" btn btn-danger"/>
          </div>
    <?php $this->endWidget();?>
</div>
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="50" class="text-center">#</th>
                <th>Tên sản phẩm</th>
                <th width="180">Hình ảnh</th>
                <th width="170">Số lượng</th>
                <th width="150">Đơn giá</th>
                <th width="150">Tạm tính</th>
            </tr>
        </thead>
        <tbody>
            <?php $i = $total = 0 ?>
            <?php foreach ($order->details as $key => $detail): ?>
            
                <tr >
                    <td class="text-center">
                    <?php $i++; echo $i ?></td>
                    <td>
                        <strong><?php echo $detail->product->name; ?></strong>
                        <div  class="cart_container_attr">
                            <?php foreach ($detail->getProperty() as $attr): ?>
                                <div>
                                    
                                <?php echo $attr['property'] . " : " . $attr['property_value'] ?>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </td>
                    <td>
                        <img src="<?php echo urlImageFolder('product') . $detail->product->getImage() ?>" width="100" />
                    </td>
                    <td>
                        <div class="pull-left" style="margin-top:5px">
                            <?php echo $detail->quantity; ?>
                        </div>
                        
                    </td>
                    <td>
                        <?php echo number_format($detail->product->getPrice(), 0, 0, '.'); ?> VND
                    </td>
                    <td>
                        <?php
                        $total_item = $detail->product->getPrice() * $detail->quantity;
                        $total += $total_item;
                        echo number_format($total_item, 0, 0, '.');
                        ?> VND
                    </td>
                </tr>
    <?php endforeach; ?>
        <tr>
            <td colspan="4"></td>
            <td>Tổng Giá</td>
            <td><?php echo number_format($total, 0, 0, '.'); ?> VND</td>
        </tr>
        
    </tbody>
    </table>
